package com.fangs.yehwangglobal.net.rx;

import io.reactivex.ObservableTransformer;
import io.reactivex.android.schedulers.AndroidSchedulers;
import io.reactivex.schedulers.Schedulers;

/**
 * 用于Rx工作流的整体线程切换
 */

public class SchedulersCompact {
    public static <T> ObservableTransformer<T, T> applyIoSchedulers() {
        return upstream -> upstream.subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());
    }
}
